package swta.crud.model

import net.liftweb.mapper._

class Bundle extends LongKeyedMapper[Bundle] with IdPK {
  def getSingleton = Bundle  
  def items: List[BundleItem] = BundleItem.findAll(By(BundleItem.bundleId, this))
  
  object discount extends MappedInt(this)
  object name extends MappedString(this, 60)
  object description extends MappedTextarea(this, 500) 
  object image extends MappedString(this, 500)
  object link extends MappedString(this, 500)  
}

object Bundle extends Bundle with LongKeyedMetaMapper[Bundle] {
  override def dbTableName = "bundles"
  override def fieldOrder = id :: name :: description :: image :: link :: Nil
}